﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SybaseTest
{
    public static class SysLog
    {
        public static void WriteSysLog(string sm)
        {
            if (File.Exists("E:\\Program\\SybaseTest\\SysLog\\log.txt"))
            {
                StreamWriter sw = new StreamWriter("E:\\Program\\SybaseTest\\SysLog\\log.txt", true);
                sw.WriteLine(sm);
                sw.WriteLine("----------------------------------------------------------------------------------------");
                sw.WriteLine("\r");
                sw.Close();
                return;
            }
            else
            {
                File.Create("E:\\Program\\SybaseTest\\SysLog\\log.txt");
                StreamWriter sw2 = new StreamWriter("E:\\Program\\SybaseTest\\SysLog\\log.txt", true);
                sw2.WriteLine(sm);
                sw2.WriteLine("----------------------------------------------------------------------------------------");
                sw2.WriteLine("\r");
                sw2.Close();
                return;
            }
        }

    }
}
